package com.hsq.ndmall.user;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;


@ComponentScan({"com.hsq.ndmall.user","com.hsq.ndmall.common"})   //  扫描包，把mybatis的配置文件加载进来
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients(basePackages = "com.hsq.ndmall.user.feign") /*启动feign 去掉restTemplate远程调用*/
public class UserCenterApplication {

    public static void main(String[] args) {
        SpringApplication.run(UserCenterApplication.class, args);
    }

    @Bean
    public PasswordEncoder getPasswordEncoder(){
        return new BCryptPasswordEncoder();
    }
}
